# Location of C/C++
CC=cc
CXX=c++
# C Flags
CFLAGS=`pkg-config --cflags playerc`
LFLAGS=`pkg-config --libs playerc`
# C++ Flags
CXXFLAGS = -std=c++0x -Wall `pkg-config --cflags playerc++`
LLFLAGS = `pkg-config --libs playerc++`
# Debugging on?
DEBUG = -g

# Make everything
all: bot_mapper bot_fire

# Mapper bots
bot_mapper: bot_mapper.c
	# Propagate number of mappers from source
	world/createempty `sed 's/[^0-9]*//g' bot_mapper.c`
	$(CC) $(DEBUG) $@.c -o $@ $(CFLAGS) $(LFLAGS)

# Firefighter bots
bot_fire: bot_fire.cc
	$(CXX) $(DEBUG) $@.cc -o $@ $(CXXFLAGS) $(LLFLAGS)

# Run the simulation
run: bot_mapper
	./start_world.sh

# Clean up
clean:
	- rm bot_mapper bot_fire

